﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OrderForm
{
   class GetTime
   {
    /*  private void getTime(object sender, EventArgs e)
      {
         DateTime.Now.ToString("HH:mm:ss tt");
      }*/

      static public bool checkTime(TimeSpan time, TimeSpan startTime, TimeSpan endTime)
      {
         if (endTime == startTime)
         {
            return true;
         }
         else if (endTime < startTime)
         {
            return DateTime.Now.TimeOfDay <= endTime ||
                DateTime.Now.TimeOfDay >= startTime;
         }
         else
         {
            return DateTime.Now.TimeOfDay >= startTime &&
                DateTime.Now.TimeOfDay <= endTime;
         }


      }
   }
}
